/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "institutioncode")
@NamedQueries({
    @NamedQuery(name = "Institutioncode.findAll", query = "SELECT i FROM Institutioncode i"),
    @NamedQuery(name = "Institutioncode.findByIdinstitutioncode", query = "SELECT i FROM Institutioncode i WHERE i.idinstitutioncode = :idinstitutioncode"),
    @NamedQuery(name = "Institutioncode.findByInstitutioncode", query = "SELECT i FROM Institutioncode i WHERE i.institutioncode = :institutioncode")})
public class Institutioncode implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idinstitutioncode")
    private Integer idinstitutioncode;
    @Basic(optional = false)
    @Column(name = "institutioncode")
    private String institutioncode;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "institutioncode", fetch = FetchType.LAZY)
    private List<Recordlevelelement> recordlevelelementList;

    public Institutioncode() {
    }

    public Institutioncode(Integer idinstitutioncode) {
        this.idinstitutioncode = idinstitutioncode;
    }

    public Institutioncode(Integer idinstitutioncode, String institutioncode) {
        this.idinstitutioncode = idinstitutioncode;
        this.institutioncode = institutioncode;
    }

    public Integer getIdinstitutioncode() {
        return idinstitutioncode;
    }

    public void setIdinstitutioncode(Integer idinstitutioncode) {
        this.idinstitutioncode = idinstitutioncode;
    }

    public String getInstitutioncode() {
        return institutioncode;
    }

    public void setInstitutioncode(String institutioncode) {
        this.institutioncode = institutioncode;
    }

    public List<Recordlevelelement> getRecordlevelelementList() {
        return recordlevelelementList;
    }

    public void setRecordlevelelementList(List<Recordlevelelement> recordlevelelementList) {
        this.recordlevelelementList = recordlevelelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idinstitutioncode != null ? idinstitutioncode.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Institutioncode)) {
            return false;
        }
        Institutioncode other = (Institutioncode) object;
        if ((this.idinstitutioncode == null && other.idinstitutioncode != null) || (this.idinstitutioncode != null && !this.idinstitutioncode.equals(other.idinstitutioncode))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Institutioncode[idinstitutioncode=" + idinstitutioncode + "]";
    }

}
